package com.emily.test.service.impl;

import com.emily.test.mapper.TCommonWebMapper;
import com.emily.test.model.TCommonWeb;
import com.emily.test.service.TCommonWebService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ：zc
 * @date ：Created in 2019/4/16 10:04
 * @description：
 */
@Transactional(rollbackFor = {Exception.class})
@Service
public class TCommonWebServiceImpl implements TCommonWebService {
    @Resource
    TCommonWebMapper tCommonWebMapper;

    @Override
    public int insert(TCommonWeb record) {
        return tCommonWebMapper.insertSelective(record);
    }

    @Override
    public void deleteCommonWeb(int id) {
        tCommonWebMapper.deleteCommonWeb(id);
    }

    @Override
    public int update(TCommonWeb tCommonWeb) {
        return tCommonWebMapper.update(tCommonWeb);
    }

    @Override
    public TCommonWeb getCommomWebById(int id) {
        return tCommonWebMapper.getCommomWebById(id);
    }

    @Override
    public List<TCommonWeb> getCommomWebByCode(String code) {
        return tCommonWebMapper.getCommomWebByCode(code);
    }

    @Override
    public List<TCommonWeb> getWebByName(String name) {
        return tCommonWebMapper.getCommomWebByName(name);
    }
}
